package com.itheima02.service;

import com.itheima02.dao.StudentDaoDemo;
import com.itheima02.domain.Student;

import java.util.ArrayList;

public class StudentServiceDemo implements ServiceDemo {
    StudentDaoDemo dao = new StudentDaoDemo();

    public ArrayList<Student> findAll() {
        ArrayList<Student> list = dao.findAll();
        return list;
    }

    public Student findById(Integer id) {
        Student stu = dao.findById(id);
        return stu;
    }

    public int insert(Student stu) {
        int res = dao.insert(stu);
        return res;
    }

    public int delete(Integer id) {
        int res = dao.delete(id);
        return res;
    }

    public int update(Student stu, Integer id) {
        int res = dao.update(stu, id);
        return res;
    }
}
